//
// SoapTrace.Net - A soap message monitoring utility. 
//
// Copyright (C) 2004 Matthew Ward
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// Matthew Ward (mrward@users.sourceforge.net)

using System;

namespace SoapTrace.Core.Diagnostics
{
	/// <summary>
	/// Represents an entry added to the <see cref="Logger"/>
	/// </summary>
	public class LogEntry
	{
		/// <summary>
		/// The log message.
		/// </summary>
		private string m_Message = String.Empty;
		
		/// <summary>
		/// The log level.
		/// </summary>
		private LogLevel m_LogLevel = LogLevel.Info;
		
		/// <summary>
		/// The date time the log entry was created.
		/// </summary>
		private DateTime m_CreationDate = DateTime.Now;
		
		/// <summary>
		/// Creates a new instance of the <see cref="LogEntry"/> class.
		/// </summary>
		public LogEntry( )
		{
		}
		
		/// <summary>
		/// Creates a new instance of the <see cref="LogEntry"/> class.
		/// </summary>
		/// <param name="message">The log message.</param>
		public LogEntry( string message )
		{
			m_Message = message;
		}
		
		/// <summary>
		/// Creates a new instance of the <see cref="LogEntry"/> class.
		/// </summary>
		/// <param name="message">The log message.</param>
		/// <param name="level">The log level.</param>
		public LogEntry( string message, LogLevel level )
		{
			m_Message = message;
			m_LogLevel = level;
		}		
		
		/// <summary>
		/// Gets or sets the log entry's creation date.
		/// </summary>
		public DateTime CreationDate
		{
			get
			{
				return m_CreationDate;
			}
			
			set
			{
				m_CreationDate = value;
			}
		}
		
		/// <summary>
		/// The message associated with this log entry.
		/// </summary>
		public string Message
		{
			get
			{
				return m_Message;
			}
			
			set
			{
				m_Message = value;
			}
		}
		
		/// <summary>
		/// Gets or sets the log level.
		/// </summary>
		public LogLevel Level
		{
			get 
			{
				return m_LogLevel;
			}
			
			set 
			{
				m_LogLevel = value;
			}
		}
	}
}
